Important R packages
pkg <- c("ggplot2", "rmarkdown", "knitr", "dplyr", "hrbrthemes", "scatterD3");
lapply(pkg, function(x) { if (!require(x, character.only = TRUE, quietly = TRUE)) {
install.packages(x);
require(x, quietly = TRUE)}
})
Example data
We will use the starwars dataset from dplyr.
head(starwars, n = 3);
## # A tibble: 3 x 13
## name height mass hair_color skin_color eye_color birth_year
## <chr> <int> <dbl> <chr> <chr> <chr> <dbl>
## 1 Luke Skywalker 172 77 blond fair blue 19
## 2 C-3PO 167 75 <NA> gold yellow 112
## 3 R2-D2 96 32 <NA> white, blue red 33
## # ... with 6 more variables: gender <chr>, homeworld <chr>, species <chr>,
## # films <list>, vehicles <list>, starships <list>